home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / MacTCP.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  22.1 KB  |  649 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MacTCP.a
  3. ;
  4. ;    Contains:    TCP Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    MacTCP 2.0.6
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__MACTCP__') = 'UNDEFINED' THEN
  21. __MACTCP__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
  30.     include 'AppleTalk.a'
  31.     ENDIF
  32. ;        include 'OSUtils.a'                                        ;
  33. ;            include 'MixedMode.a'                                    ;
  34. ;            include 'Memory.a'                                        ;
  35. ;
  36. ;Developer Notes:
  37. ;        0. This MacTCP header replaces what used to be defined in the following header files
  38. ;            MacTCPCommonTypes.h
  39. ;            GetMyIPAddr.h
  40. ;            MiscIPPB.h
  41. ;            TCPPB.h
  42. ;            UDPPB.h 
  43. ;            
  44. ;            When the various control calls are made to the ip driver, you must set up a 
  45. ;            NewRoutineDescriptor for every non-nil completion routine and/or notifyProc parameter.  
  46. ;            Otherwise, the 68K driver code, will not correctly call your routine.
  47. ;        1. For ipctlGetAddr Control calls, use NewGetIPIOCompletionProc
  48. ;            to set up a GetIPIOCompletionUPP universal procptr to pass as
  49. ;            the ioCompletion parameter.
  50. ;        2. For the ipctlEchoICMP and ipctlLAPStats Control calls, use 
  51. ;            NewIPIOCompletion to set up a IPIOCompletionUPP universal procptr
  52. ;            to pass in the ioCompletion field of the parameter block.
  53. ;        3. For TCPCreatePB Control calls, use NewTCPNotifyProc to set up a
  54. ;            TCPNotifyUPP universal procptr to pass in the notifyProc field
  55. ;            of the parameter block
  56. ;        4. For all of the TCP Control calls using the TCPiopb parameter block,
  57. ;            use NewTCPIOCompletionProc to set up a TCPIOCompletionUPP
  58. ;            universal procptr to pass in the ioCompletion field of the paramter
  59. ;            block.
  60. ;        5. For UDBCreatePB Control calls, use NewUDPNotifyProc to set up a
  61. ;            UDPNotifyUPP universal procptr to pass in the notifyProc field
  62. ;            of the parameter block
  63. ;        6. For all of the UDP Control calls using the UDPiopb parameter block,
  64. ;            use NewUDPIOCompletionProc to set up a UDPIOCompletionUPP
  65. ;            universal procptr to pass in the ioCompletion field of the paramter
  66. ;            block.
  67. ;        7. For all calls implementing a notifyProc or ioCompletion routine
  68. ;            which was set up using a NewTCPRoutineProc call, do not call
  69. ;            DisposeRoutineSDescriptor on the universal procptr until
  70. ;            after the completion or notify proc has completed.
  71. ;
  72. ; MacTCP return Codes in the range -23000 through -23049 
  73.  
  74. inProgress                        EQU        1                    ; I/O in progress 
  75. ipBadLapErr                        EQU        -23000                ; bad network configuration 
  76. ipBadCnfgErr                    EQU        -23001                ; bad IP configuration error 
  77. ipNoCnfgErr                        EQU        -23002                ; missing IP or LAP configuration error 
  78. ipLoadErr                        EQU        -23003                ; error in MacTCP load 
  79. ipBadAddr                        EQU        -23004                ; error in getting address 
  80. connectionClosing                EQU        -23005                ; connection is closing 
  81. invalidLength                    EQU        -23006
  82. connectionExists                EQU        -23007                ; request conflicts with existing connection 
  83. connectionDoesntExist            EQU        -23008                ; connection does not exist 
  84. insufficientResources            EQU        -23009                ; insufficient resources to perform request 
  85. invalidStreamPtr                EQU        -23010
  86. streamAlreadyOpen                EQU        -23011
  87. connectionTerminated            EQU        -23012
  88. invalidBufPtr                    EQU        -23013
  89. invalidRDS                        EQU        -23014
  90. invalidWDS                        EQU        -23014
  91. openFailed                        EQU        -23015
  92. commandTimeout                    EQU        -23016
  93. duplicateSocket                    EQU        -23017
  94.  
  95. ; Error codes from internal IP functions 
  96. ipDontFragErr                    EQU        -23032                ; Packet too large to send w/o fragmenting 
  97. ipDestDeadErr                    EQU        -23033                ; destination not responding 
  98. icmpEchoTimeoutErr                EQU        -23035                ; ICMP echo timed-out 
  99. ipNoFragMemErr                    EQU        -23036                ; no memory to send fragmented pkt 
  100. ipRouteErr                        EQU        -23037                ; can't route packet off-net 
  101. nameSyntaxErr                    EQU        -23041
  102. cacheFault                        EQU        -23042
  103. noResultProc                    EQU        -23043
  104. noNameServer                    EQU        -23044
  105. authNameErr                        EQU        -23045
  106. noAnsErr                        EQU        -23046
  107. dnrErr                            EQU        -23047
  108. outOfMemory                        EQU        -23048
  109.  
  110. BYTES_16WORD                    EQU        2                    ; bytes per = 16, bit ip word 
  111. BYTES_32WORD                    EQU        4                    ; bytes per = 32, bit ip word 
  112. BYTES_64WORD                    EQU        8                    ; bytes per = 64, bit ip word 
  113.  
  114. ; 8-bit quantity 
  115. ; typedef UInt8             b_8
  116. ; 16-bit quantity 
  117. ; typedef UInt16             b_16
  118. ; 32-bit quantity 
  119. ; typedef UInt32             b_32
  120. ; IP address is 32-bits 
  121. ; typedef b_32                 ip_addr
  122. ip_addrbytes             RECORD    0
  123. addr                     ds.l   1        ; offset: $0 (0)
  124.                          ORG 0
  125. byte                     ds.b   4        ; offset: $0 (0)
  126.                          ORG 4
  127. sizeof                     EQU *            ; size:   $4 (4)
  128.                         ENDR
  129.  
  130. ; typedef struct ip_addrbytes  ip_addrbytes
  131. wdsEntry                 RECORD    0
  132. length                     ds.w   1        ; offset: $0 (0)        ; length of buffer 
  133. ptr                         ds.l   1        ; offset: $2 (2)        ; pointer to buffer 
  134. sizeof                     EQU *            ; size:   $6 (6)
  135.                         ENDR
  136.  
  137. ; typedef struct wdsEntry     wdsEntry
  138. rdsEntry                 RECORD    0
  139. length                     ds.w   1        ; offset: $0 (0)        ; length of buffer 
  140. ptr                         ds.l   1        ; offset: $2 (2)        ; pointer to buffer 
  141. sizeof                     EQU *            ; size:   $6 (6)
  142.                         ENDR
  143.  
  144. ; typedef struct rdsEntry     rdsEntry
  145. ; typedef unsigned long     BufferPtr
  146. ; typedef unsigned long     StreamPtr
  147.  
  148. netUnreach                        EQU        0
  149. hostUnreach                        EQU        1
  150. protocolUnreach                    EQU        2
  151. portUnreach                        EQU        3
  152. fragReqd                        EQU        4
  153. sourceRouteFailed                EQU        5
  154. timeExceeded                    EQU        6
  155. parmProblem                        EQU        7
  156. missingOption                    EQU        8
  157. lastICMPMsgType                    EQU        32767
  158.  
  159. ; typedef unsigned short     ICMPMsgType
  160. ; typedef b_16                 ip_port
  161. ICMPReport                 RECORD    0
  162. streamPtr                 ds.l   1        ; offset: $0 (0)
  163. localHost                 ds.l   1        ; offset: $4 (4)
  164. localPort                 ds.w   1        ; offset: $8 (8)
  165. remoteHost                 ds.l   1        ; offset: $A (10)
  166. remotePort                 ds.w   1        ; offset: $E (14)
  167. reportType                 ds.w   1        ; offset: $10 (16)
  168. optionalAddlInfo         ds.w   1        ; offset: $12 (18)
  169. optionalAddlInfoPtr         ds.l   1        ; offset: $14 (20)
  170. sizeof                     EQU *            ; size:   $18 (24)
  171.                         ENDR
  172.  
  173. ; typedef struct ICMPReport  ICMPReport
  174. ; csCode to get our IP address 
  175.  
  176. ipctlGetAddr                    EQU        15
  177.  
  178. GetAddrParamBlock         RECORD    0
  179. qLink                     ds.l   1        ; offset: $0 (0)
  180. qType                     ds.w   1        ; offset: $4 (4)
  181. ioTrap                     ds.w   1        ; offset: $6 (6)
  182. ioCmdAddr                 ds.l   1        ; offset: $8 (8)
  183. ioCompletion             ds.l   1        ; offset: $C (12)
  184. ioResult                 ds.w   1        ; offset: $10 (16)
  185. ioNamePtr                 ds.l   1        ; offset: $12 (18)
  186. ioVRefNum                 ds.w   1        ; offset: $16 (22)
  187. ioCRefNum                 ds.w   1        ; offset: $18 (24)
  188. csCode                     ds.w   1        ; offset: $1A (26)        ; standard I/O header 
  189. ourAddress                 ds.l   1        ; offset: $1C (28)        ; our IP address 
  190. ourNetMask                 ds.l   1        ; offset: $20 (32)        ; our IP net mask 
  191. sizeof                     EQU *            ; size:   $24 (36)
  192.                         ENDR
  193.  
  194. ; typedef struct GetAddrParamBlock  GetAddrParamBlock
  195. ; control codes 
  196.  
  197. ipctlEchoICMP                    EQU        17                    ; send icmp echo 
  198. ipctlLAPStats                    EQU        19                    ; get lap stats 
  199.  
  200. ICMPParamBlock             RECORD    0
  201. qLink                     ds.l   1        ; offset: $0 (0)
  202. qType                     ds.w   1        ; offset: $4 (4)
  203. ioTrap                     ds.w   1        ; offset: $6 (6)
  204. ioCmdAddr                 ds.l   1        ; offset: $8 (8)
  205. ioCompletion             ds.l   1        ; offset: $C (12)
  206. ioResult                 ds.w   1        ; offset: $10 (16)
  207. ioNamePtr                 ds.l   1        ; offset: $12 (18)
  208. ioVRefNum                 ds.w   1        ; offset: $16 (22)
  209. ioCRefNum                 ds.w   1        ; offset: $18 (24)
  210. csCode                     ds.w   1        ; offset: $1A (26)        ; standard I/O header 
  211. params                     ds.w   11        ; offset: $1C (28)
  212. echoRequestOut             ds.l   1        ; offset: $32 (50)        ; time in ticks of when the echo request went out 
  213. echoReplyIn                 ds.l   1        ; offset: $36 (54)        ; time in ticks of when the reply was received 
  214. echoedData                 ds     rdsEntry ; offset: $3A (58)        ; data received in responce 
  215. options                     ds.l   1        ; offset: $40 (64)
  216. userDataPtr                 ds.l   1        ; offset: $44 (68)
  217. sizeof                     EQU *            ; size:   $48 (72)
  218.                         ENDR
  219.  
  220. IPParamBlock             RECORD    0
  221. qLink                     ds.l   1        ; offset: $0 (0)
  222. qType                     ds.w   1        ; offset: $4 (4)
  223. ioTrap                     ds.w   1        ; offset: $6 (6)
  224. ioCmdAddr                 ds.l   1        ; offset: $8 (8)
  225. ioCompletion             ds.l   1        ; offset: $C (12)
  226. ioResult                 ds.w   1        ; offset: $10 (16)
  227. ioNamePtr                 ds.l   1        ; offset: $12 (18)
  228. ioVRefNum                 ds.w   1        ; offset: $16 (22)
  229. ioCRefNum                 ds.w   1        ; offset: $18 (24)
  230. csCode                     ds.w   1        ; offset: $1A (26)        ; standard I/O header 
  231. dest                     ds.l   1        ; offset: $1C (28)        ; echo to IP address 
  232. data                     ds     wdsEntry ; offset: $20 (32)
  233. timeout                     ds.w   1        ; offset: $26 (38)
  234. options                     ds.l   1        ; offset: $28 (40)
  235. optLength                 ds.w   1        ; offset: $2C (44)
  236. icmpCompletion             ds.l   1        ; offset: $2E (46)
  237. userDataPtr                 ds.l   1        ; offset: $32 (50)
  238.                          ORG 28
  239. lapStatsPtr                 ds.l   1        ; offset: $1C (28)
  240.                          ORG 54
  241. sizeof                     EQU *            ; size:   $36 (54)
  242.                         ENDR
  243.  
  244. LAPStatsAddrXlation     RECORD    0
  245. arp_table                 ds.l   1        ; offset: $0 (0)
  246.                          ORG 0
  247. nbp_table                 ds.l   1        ; offset: $0 (0)
  248.                          ORG 4
  249. sizeof                     EQU *            ; size:   $4 (4)
  250.                         ENDR
  251.  
  252. LAPStats                 RECORD    0
  253. ifType                     ds.w   1        ; offset: $0 (0)
  254. ifString                 ds.l   1        ; offset: $2 (2)
  255. ifMaxMTU                 ds.w   1        ; offset: $6 (6)
  256. ifSpeed                     ds.l   1        ; offset: $8 (8)
  257. ifPhyAddrLength             ds.w   1        ; offset: $C (12)
  258. ifPhysicalAddress         ds.l   1        ; offset: $E (14)
  259. AddrXlation                 ds.l   1        ; offset: $12 (18)
  260. slotNumber                 ds.w   1        ; offset: $16 (22)
  261. sizeof                     EQU *            ; size:   $18 (24)
  262.                         ENDR
  263.  
  264. ; typedef struct LAPStats     LAPStats
  265. nbp_entry                 RECORD    0
  266. ip_address                 ds.l   1        ; offset: $0 (0)        ; IP address 
  267. at_address                 ds     AddrBlock ; offset: $4 (4)        ; matching AppleTalk address 
  268. gateway                     ds.b   1        ; offset: $8 (8)        ; TRUE if entry for a gateway 
  269. valid                     ds.b   1        ; offset: $9 (9)        ; TRUE if LAP address is valid 
  270. probing                     ds.b   1        ; offset: $A (10)        ; TRUE if NBP lookup pending 
  271. afiller                     ds.b   1        ; offset: $B (11)        ; Filler for proper byte alignment     
  272. age                         ds.l   1        ; offset: $C (12)        ; ticks since cache entry verified 
  273. access                     ds.l   1        ; offset: $10 (16)        ; ticks since last access 
  274. filler                     ds.b   116        ; offset: $14 (20)        ; for internal use only !!! 
  275. sizeof                     EQU *            ; size:   $88 (136)
  276.                         ENDR
  277.  
  278. Enet_addr                 RECORD    0
  279. en_hi                     ds.w   1        ; offset: $0 (0)
  280. en_lo                     ds.l   1        ; offset: $2 (2)
  281. sizeof                     EQU *            ; size:   $6 (6)
  282.                         ENDR
  283.  
  284. ; typedef struct Enet_addr     Enet_addr
  285. arp_entry                 RECORD    0
  286. age                         ds.w   1        ; offset: $0 (0)        ; cache aging field 
  287. protocol                 ds.w   1        ; offset: $2 (2)        ; Protocol type 
  288. ip_address                 ds.l   1        ; offset: $4 (4)        ; IP address 
  289. en_address                 ds     Enet_addr ; offset: $8 (8)        ; matching Ethernet address 
  290. sizeof                     EQU *            ; size:   $E (14)
  291.                         ENDR
  292.  
  293. ; typedef struct arp_entry     arp_entry
  294. ; number of ARP table entries 
  295.  
  296. ARP_TABLE_SIZE                    EQU        20
  297.  
  298. NBP_TABLE_SIZE                    EQU        20                    ; number of NBP table entries 
  299. NBP_MAX_NAME_SIZE                EQU        16 + 10 + 2
  300.  
  301. ; Command codes 
  302. TCPCreate                        EQU        30
  303. TCPPassiveOpen                    EQU        31
  304. TCPActiveOpen                    EQU        32
  305. TCPSend                            EQU        34
  306. TCPNoCopyRcv                    EQU        35
  307. TCPRcvBfrReturn                    EQU        36
  308. TCPRcv                            EQU        37
  309. TCPClose                        EQU        38
  310. TCPAbort                        EQU        39
  311. TCPStatus                        EQU        40
  312. TCPExtendedStat                    EQU        41
  313. TCPRelease                        EQU        42
  314. TCPGlobalInfo                    EQU        43
  315. TCPCtlMax                        EQU        49
  316.  
  317. TCPClosing                        EQU        1
  318. TCPULPTimeout                    EQU        2
  319. TCPTerminate                    EQU        3
  320. TCPDataArrival                    EQU        4
  321. TCPUrgent                        EQU        5
  322. TCPICMPReceived                    EQU        6
  323. lastEvent                        EQU        32767
  324.  
  325. ; typedef unsigned short     TCPEventCode
  326.  
  327. TCPRemoteAbort                    EQU        2
  328. TCPNetworkFailure                EQU        3
  329. TCPSecPrecMismatch                EQU        4
  330. TCPULPTimeoutTerminate            EQU        5
  331. TCPULPAbort                        EQU        6
  332. TCPULPClose                        EQU        7
  333. TCPServiceError                    EQU        8
  334. lastReason                        EQU        32767
  335.  
  336. ; typedef unsigned short     TCPTerminationReason
  337. ; typedef unsigned short     tcp_port
  338. ; ValidityFlags 
  339.  
  340. timeoutValue                    EQU        $80
  341. timeoutAction                    EQU        $40
  342. typeOfService                    EQU        $20
  343. precedence                        EQU        $10
  344.  
  345. ; TOSFlags 
  346. lowDelay                        EQU        $01
  347. throughPut                        EQU        $02
  348. reliability                        EQU        $04
  349.  
  350. TCPCreatePB             RECORD    0
  351. rcvBuff                     ds.l   1        ; offset: $0 (0)
  352. rcvBuffLen                 ds.l   1        ; offset: $4 (4)
  353. notifyProc                 ds.l   1        ; offset: $8 (8)
  354. userDataPtr                 ds.l   1        ; offset: $C (12)
  355. sizeof                     EQU *            ; size:   $10 (16)
  356.                         ENDR
  357.  
  358. ; typedef struct TCPCreatePB  TCPCreatePB
  359. TCPOpenPB                 RECORD    0
  360. ulpTimeoutValue             ds.b   1        ; offset: $0 (0)
  361. ulpTimeoutAction         ds.b   1        ; offset: $1 (1)
  362. validityFlags             ds.b   1        ; offset: $2 (2)
  363. commandTimeoutValue         ds.b   1        ; offset: $3 (3)
  364. remoteHost                 ds.l   1        ; offset: $4 (4)
  365. remotePort                 ds.w   1        ; offset: $8 (8)
  366. localHost                 ds.l   1        ; offset: $A (10)
  367. localPort                 ds.w   1        ; offset: $E (14)
  368. tosFlags                 ds.b   1        ; offset: $10 (16)
  369. precedence                 ds.b   1        ; offset: $11 (17)
  370. dontFrag                 ds.b   1        ; offset: $12 (18)
  371. timeToLive                 ds.b   1        ; offset: $13 (19)
  372. security                 ds.b   1        ; offset: $14 (20)
  373. optionCnt                 ds.b   1        ; offset: $15 (21)
  374. options                     ds.b   40        ; offset: $16 (22)
  375. userDataPtr                 ds.l   1        ; offset: $3E (62)
  376. sizeof                     EQU *            ; size:   $42 (66)
  377.                         ENDR
  378.  
  379. ; typedef struct TCPOpenPB     TCPOpenPB
  380. TCPSendPB                 RECORD    0
  381. ulpTimeoutValue             ds.b   1        ; offset: $0 (0)
  382. ulpTimeoutAction         ds.b   1        ; offset: $1 (1)
  383. validityFlags             ds.b   1        ; offset: $2 (2)
  384. pushFlag                 ds.b   1        ; offset: $3 (3)
  385. urgentFlag                 ds.b   1        ; offset: $4 (4)
  386. filler                     ds.b   1        ; offset: $5 (5)        ; Filler for proper byte alignment     
  387. wdsPtr                     ds.l   1        ; offset: $6 (6)
  388. sendFree                 ds.l   1        ; offset: $A (10)
  389. sendLength                 ds.w   1        ; offset: $E (14)
  390. userDataPtr                 ds.l   1        ; offset: $10 (16)
  391. sizeof                     EQU *            ; size:   $14 (20)
  392.                         ENDR
  393.  
  394. ; typedef struct TCPSendPB     TCPSendPB
  395. ; for receive and return rcv buff calls 
  396. ;   Note: the filler in the following structure is in a different location than 
  397. ;         that specified in the Programmer's Guide.  
  398. TCPReceivePB             RECORD    0
  399. commandTimeoutValue         ds.b   1        ; offset: $0 (0)
  400. markFlag                 ds.b   1        ; offset: $1 (1)
  401. urgentFlag                 ds.b   1        ; offset: $2 (2)
  402. filler                     ds.b   1        ; offset: $3 (3)        ; Filler for proper byte alignment  
  403. rcvBuff                     ds.l   1        ; offset: $4 (4)
  404. rcvBuffLen                 ds.w   1        ; offset: $8 (8)
  405. rdsPtr                     ds.l   1        ; offset: $A (10)
  406. rdsLength                 ds.w   1        ; offset: $E (14)
  407. secondTimeStamp             ds.w   1        ; offset: $10 (16)
  408. userDataPtr                 ds.l   1        ; offset: $12 (18)
  409. sizeof                     EQU *            ; size:   $16 (22)
  410.                         ENDR
  411.  
  412. ; typedef struct TCPReceivePB  TCPReceivePB
  413. TCPClosePB                 RECORD    0
  414. ulpTimeoutValue             ds.b   1        ; offset: $0 (0)
  415. ulpTimeoutAction         ds.b   1        ; offset: $1 (1)
  416. validityFlags             ds.b   1        ; offset: $2 (2)
  417. filler                     ds.b   1        ; offset: $3 (3)        ; Filler for proper byte alignment     
  418. userDataPtr                 ds.l   1        ; offset: $4 (4)
  419. sizeof                     EQU *            ; size:   $8 (8)
  420.                         ENDR
  421.  
  422. ; typedef struct TCPClosePB  TCPClosePB
  423. HistoBucket             RECORD    0
  424. value                     ds.w   1        ; offset: $0 (0)
  425. counter                     ds.l   1        ; offset: $2 (2)
  426. sizeof                     EQU *            ; size:   $6 (6)
  427.                         ENDR
  428.  
  429. ; typedef struct HistoBucket  HistoBucket
  430.  
  431. NumOfHistoBuckets                EQU        7
  432.  
  433. TCPConnectionStats         RECORD    0
  434. dataPktsRcvd             ds.l   1        ; offset: $0 (0)
  435. dataPktsSent             ds.l   1        ; offset: $4 (4)
  436. dataPktsResent             ds.l   1        ; offset: $8 (8)
  437. bytesRcvd                 ds.l   1        ; offset: $C (12)
  438. bytesRcvdDup             ds.l   1        ; offset: $10 (16)
  439. bytesRcvdPastWindow         ds.l   1        ; offset: $14 (20)
  440. bytesSent                 ds.l   1        ; offset: $18 (24)
  441. bytesResent                 ds.l   1        ; offset: $1C (28)
  442. numHistoBuckets             ds.w   1        ; offset: $20 (32)
  443. sentSizeHisto             ds.b   7 * HistoBucket.sizeof ; offset: $22 (34)
  444. lastRTT                     ds.w   1        ; offset: $4C (76)
  445. tmrSRTT                     ds.w   1        ; offset: $4E (78)
  446. rttVariance                 ds.w   1        ; offset: $50 (80)
  447. tmrRTO                     ds.w   1        ; offset: $52 (82)
  448. sendTries                 ds.b   1        ; offset: $54 (84)
  449. sourchQuenchRcvd         ds.b   1        ; offset: $55 (85)
  450. sizeof                     EQU *            ; size:   $56 (86)
  451.                         ENDR
  452.  
  453. ; typedef struct TCPConnectionStats  TCPConnectionStats
  454. TCPStatusPB             RECORD    0
  455. ulpTimeoutValue             ds.b   1        ; offset: $0 (0)
  456. ulpTimeoutAction         ds.b   1        ; offset: $1 (1)
  457. unused                     ds.l   1        ; offset: $2 (2)
  458. remoteHost                 ds.l   1        ; offset: $6 (6)
  459. remotePort                 ds.w   1        ; offset: $A (10)
  460. localHost                 ds.l   1        ; offset: $C (12)
  461. localPort                 ds.w   1        ; offset: $10 (16)
  462. tosFlags                 ds.b   1        ; offset: $12 (18)
  463. precedence                 ds.b   1        ; offset: $13 (19)
  464. connectionState             ds.b   1        ; offset: $14 (20)
  465. filler                     ds.b   1        ; offset: $15 (21)        ; Filler for proper byte alignment     
  466. sendWindow                 ds.w   1        ; offset: $16 (22)
  467. rcvWindow                 ds.w   1        ; offset: $18 (24)
  468. amtUnackedData             ds.w   1        ; offset: $1A (26)
  469. amtUnreadData             ds.w   1        ; offset: $1C (28)
  470. securityLevelPtr         ds.l   1        ; offset: $1E (30)
  471. sendUnacked                 ds.l   1        ; offset: $22 (34)
  472. sendNext                 ds.l   1        ; offset: $26 (38)
  473. congestionWindow         ds.l   1        ; offset: $2A (42)
  474. rcvNext                     ds.l   1        ; offset: $2E (46)
  475. srtt                     ds.l   1        ; offset: $32 (50)
  476. lastRTT                     ds.l   1        ; offset: $36 (54)
  477. sendMaxSegSize             ds.l   1        ; offset: $3A (58)
  478. connStatPtr                 ds.l   1        ; offset: $3E (62)
  479. userDataPtr                 ds.l   1        ; offset: $42 (66)
  480. sizeof                     EQU *            ; size:   $46 (70)
  481.                         ENDR
  482.  
  483. ; typedef struct TCPStatusPB  TCPStatusPB
  484. TCPAbortPB                 RECORD    0
  485. userDataPtr                 ds.l   1        ; offset: $0 (0)
  486. sizeof                     EQU *            ; size:   $4 (4)
  487.                         ENDR
  488.  
  489. ; typedef struct TCPAbortPB  TCPAbortPB
  490. TCPParam                 RECORD    0
  491. tcpRtoA                     ds.l   1        ; offset: $0 (0)
  492. tcpRtoMin                 ds.l   1        ; offset: $4 (4)
  493. tcpRtoMax                 ds.l   1        ; offset: $8 (8)
  494. tcpMaxSegSize             ds.l   1        ; offset: $C (12)
  495. tcpMaxConn                 ds.l   1        ; offset: $10 (16)
  496. tcpMaxWindow             ds.l   1        ; offset: $14 (20)
  497. sizeof                     EQU *            ; size:   $18 (24)
  498.                         ENDR
  499.  
  500. ; typedef struct TCPParam     TCPParam
  501. TCPStats                 RECORD    0
  502. tcpConnAttempts             ds.l   1        ; offset: $0 (0)
  503. tcpConnOpened             ds.l   1        ; offset: $4 (4)
  504. tcpConnAccepted             ds.l   1        ; offset: $8 (8)
  505. tcpConnClosed             ds.l   1        ; offset: $C (12)
  506. tcpConnAborted             ds.l   1        ; offset: $10 (16)
  507. tcpOctetsIn                 ds.l   1        ; offset: $14 (20)
  508. tcpOctetsOut             ds.l   1        ; offset: $18 (24)
  509. tcpOctetsInDup             ds.l   1        ; offset: $1C (28)
  510. tcpOctetsRetrans         ds.l   1        ; offset: $20 (32)
  511. tcpInputPkts             ds.l   1        ; offset: $24 (36)
  512. tcpOutputPkts             ds.l   1        ; offset: $28 (40)
  513. tcpDupPkts                 ds.l   1        ; offset: $2C (44)
  514. tcpRetransPkts             ds.l   1        ; offset: $30 (48)
  515. sizeof                     EQU *            ; size:   $34 (52)
  516.                         ENDR
  517.  
  518. ; typedef struct TCPStats     TCPStats
  519. ; typedef StreamPtr         *StreamPPtr
  520. TCPGlobalInfoPB         RECORD    0
  521. tcpParamPtr                 ds.l   1        ; offset: $0 (0)
  522. tcpStatsPtr                 ds.l   1        ; offset: $4 (4)
  523. tcpCDBTable                 ds.l   1        ; offset: $8 (8)
  524. userDataPtr                 ds.l   1        ; offset: $C (12)
  525. maxTCPConnections         ds.w   1        ; offset: $10 (16)
  526. sizeof                     EQU *            ; size:   $12 (18)
  527.                         ENDR
  528.  
  529. ; typedef struct TCPGlobalInfoPB  TCPGlobalInfoPB
  530. TCPiopb                 RECORD    0
  531. fill12                     ds.b   12        ; offset: $0 (0)
  532. ioCompletion             ds.l   1        ; offset: $C (12)
  533. ioResult                 ds.w   1        ; offset: $10 (16)
  534. ioNamePtr                 ds.l   1        ; offset: $12 (18)
  535. ioVRefNum                 ds.w   1        ; offset: $16 (22)
  536. ioCRefNum                 ds.w   1        ; offset: $18 (24)
  537. csCode                     ds.w   1        ; offset: $1A (26)
  538. tcpStream                 ds.l   1        ; offset: $1C (28)
  539. create                     ds     TCPCreatePB ; offset: $20 (32)
  540.                          ORG 32
  541. open                     ds     TCPOpenPB ; offset: $20 (32)
  542.                          ORG 32
  543. send                     ds     TCPSendPB ; offset: $20 (32)
  544.                          ORG 32
  545. receive                     ds     TCPReceivePB ; offset: $20 (32)
  546.                          ORG 32
  547. close                     ds     TCPClosePB ; offset: $20 (32)
  548.                          ORG 32
  549. abort                     ds     TCPAbortPB ; offset: $20 (32)
  550.                          ORG 32
  551. status                     ds     TCPStatusPB ; offset: $20 (32)
  552.                          ORG 32
  553. globalInfo                 ds     TCPGlobalInfoPB ; offset: $20 (32)
  554.                          ORG 102
  555. sizeof                     EQU *            ; size:   $66 (102)
  556.                         ENDR
  557.  
  558. ; typedef struct TCPiopb     TCPiopb
  559.  
  560. UDPCreate                        EQU        20
  561. UDPRead                            EQU        21
  562. UDPBfrReturn                    EQU        22
  563. UDPWrite                        EQU        23
  564. UDPRelease                        EQU        24
  565. UDPMaxMTUSize                    EQU        25
  566. UDPStatus                        EQU        26
  567. UDPMultiCreate                    EQU        27
  568. UDPMultiSend                    EQU        28
  569. UDPMultiRead                    EQU        29
  570. UDPCtlMax                        EQU        29
  571.  
  572. UDPDataArrival                    EQU        1
  573. UDPICMPReceived                    EQU        2
  574. lastUDPEvent                    EQU        32767
  575.  
  576. ; typedef unsigned short     UDPEventCode
  577. ; typedef unsigned short     udp_port
  578. ; for create and release calls 
  579. UDPCreatePB             RECORD    0
  580. rcvBuff                     ds.l   1        ; offset: $0 (0)
  581. rcvBuffLen                 ds.l   1        ; offset: $4 (4)
  582. notifyProc                 ds.l   1        ; offset: $8 (8)
  583. localPort                 ds.w   1        ; offset: $C (12)
  584. userDataPtr                 ds.l   1        ; offset: $E (14)
  585. endingPort                 ds.w   1        ; offset: $12 (18)
  586. sizeof                     EQU *            ; size:   $14 (20)
  587.                         ENDR
  588.  
  589. ; typedef struct UDPCreatePB  UDPCreatePB
  590. UDPSendPB                 RECORD    0
  591. reserved                 ds.w   1        ; offset: $0 (0)
  592. remoteHost                 ds.l   1        ; offset: $2 (2)
  593. remotePort                 ds.w   1        ; offset: $6 (6)
  594. wdsPtr                     ds.l   1        ; offset: $8 (8)
  595. checkSum                 ds.b   1        ; offset: $C (12)
  596. filler                     ds.b   1        ; offset: $D (13)        ; Filler for proper byte alignment     
  597. sendLength                 ds.w   1        ; offset: $E (14)
  598. userDataPtr                 ds.l   1        ; offset: $10 (16)
  599. localPort                 ds.w   1        ; offset: $14 (20)
  600. sizeof                     EQU *            ; size:   $16 (22)
  601.                         ENDR
  602.  
  603. ; typedef struct UDPSendPB     UDPSendPB
  604. ; for receive and buffer return calls 
  605. UDPReceivePB             RECORD    0
  606. timeOut                     ds.w   1        ; offset: $0 (0)
  607. remoteHost                 ds.l   1        ; offset: $2 (2)
  608. remotePort                 ds.w   1        ; offset: $6 (6)
  609. rcvBuff                     ds.l   1        ; offset: $8 (8)
  610. rcvBuffLen                 ds.w   1        ; offset: $C (12)
  611. secondTimeStamp             ds.w   1        ; offset: $E (14)
  612. userDataPtr                 ds.l   1        ; offset: $10 (16)
  613. destHost                 ds.l   1        ; offset: $14 (20)        ; only for use with multi rcv 
  614. destPort                 ds.w   1        ; offset: $18 (24)        ; only for use with multi rcv 
  615. sizeof                     EQU *            ; size:   $1A (26)
  616.                         ENDR
  617.  
  618. ; typedef struct UDPReceivePB  UDPReceivePB
  619. UDPMTUPB                 RECORD    0
  620. mtuSize                     ds.w   1        ; offset: $0 (0)
  621. remoteHost                 ds.l   1        ; offset: $2 (2)
  622. userDataPtr                 ds.l   1        ; offset: $6 (6)
  623. sizeof                     EQU *            ; size:   $A (10)
  624.                         ENDR
  625.  
  626. ; typedef struct UDPMTUPB     UDPMTUPB
  627. UDPiopb                 RECORD    0
  628. fill12                     ds.b   12        ; offset: $0 (0)
  629. ioCompletion             ds.l   1        ; offset: $C (12)
  630. ioResult                 ds.w   1        ; offset: $10 (16)
  631. ioNamePtr                 ds.l   1        ; offset: $12 (18)
  632. ioVRefNum                 ds.w   1        ; offset: $16 (22)
  633. ioCRefNum                 ds.w   1        ; offset: $18 (24)
  634. csCode                     ds.w   1        ; offset: $1A (26)
  635. udpStream                 ds.l   1        ; offset: $1C (28)
  636. create                     ds     UDPCreatePB ; offset: $20 (32)
  637.                          ORG 32
  638. send                     ds     UDPSendPB ; offset: $20 (32)
  639.                          ORG 32
  640. receive                     ds     UDPReceivePB ; offset: $20 (32)
  641.                          ORG 32
  642. mtu                         ds     UDPMTUPB ; offset: $20 (32)
  643.                          ORG 58
  644. sizeof                     EQU *            ; size:   $3A (58)
  645.                         ENDR
  646.  
  647. ; typedef struct UDPiopb     UDPiopb
  648.     ENDIF ; __MACTCP__
  649.